<template>
  <div>
    <div class="fly-panel">
      <div class="fly-panel-title">
        广告区域
      </div>
      <div class="fly-panel-main">
        <span
            class="advertising"
            v-for="item of list"
            :key="item.id"
            @click="locationHref(item.link_url)"
        >
          <img :src="item.http_url" alt="">
        </span>
      </div>
    </div>
  </div>
</template>

<script>
import {advertising} from "@/api";

export default {
  name: 'Advertising',
  data () {
    return {
      list: []
    }
  },
  methods: {
    getAdvertising: function () {
      advertising(1).then(this.getAdvertisingSucc)
    },
    getAdvertisingSucc: function (res) {
      this.list = res.data.data
    },
    locationHref: function (url) {
      window.open(url, '_blank')
    }
  },
  mounted () {
    this.getAdvertising()
  }
}
</script>

<style scoped>
.advertising {
  display: block;
  /*border-bottom: 1px dotted #E9E9E9;*/
  line-height: 50px
}
</style>